package com.ruoyi.common.entity.BO;

import lombok.Data;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Data
public class StatisticsBO {
    private int countVal;
    private BigDecimal sumVal;
    private double mtm;

    public Map<String, Object> output() {
        Map<String, Object> output = new HashMap<>();
        if (sumVal == null || sumVal.compareTo(BigDecimal.ZERO) == 0 || sumVal.compareTo(BigDecimal.valueOf(0)) == 0) {
            output.put("countVal", String.valueOf(getCountVal()));
        }else{
            output.put("countVal", String.valueOf(getSumVal()));
        }
        output.put("mtm", getMtm());
        return output;
    }
}
